package cn.iocoder.yudao.module.system.util;

import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

import lombok.Data;

@Data
@Root(name = "xml", strict = false)
public class PushMessage {

    /**
     * 接收该事件的公众号原始id
     */
    @Element(name = "ToUserName")
    private String ToUserName;

    /**
     * 事件发起人，该事件中标识下单购买人的openid
     */
    @Element(name = "FromUserName")
    private String FromUserName;

    /**
     * 事件创建时间
     */
    @Element(name = "CreateTime", required = false)
    private Long CreateTime;

    /**
     * 消息类型
     */
    @Element(name = "MsgType", required = false)
    private String MsgType;

    /**
     * 事件类型
     */
    @Element(name = "Event", required = false)
    private String Event;

    /**
     * 货架的id
     */
    @Element(name = "PageId", required = false)
    private String PageId;

    /**
     * 订单号
     */
    @Element(name = "OrderId", required = false)
    private String OrderId;

    /**
     * 礼品卡是否发送至群，true为是
     */
    @Element(name = "IsChatRoom", required = false)
    private Boolean IsChatRoom;

    /**
     * 标识礼品卡是否因超过24小时未被领取，退回卡包。True时表明超时退回卡包
     */
    @Element(name = "IsReturnBack", required = false)
    private Boolean IsReturnBack;

    /**
     * 是否来自好友转赠
     */
    @Element(name = "Cardid", required = false)
    private String Cardid;

    /**
     * 是否来自好友转赠
     */
    @Element(name = "IsGiveByFriend", required = false)
    private Integer IsGiveByFriend;

    /**
     * 用户领取到的code
     */
    @Element(name = "UserCardCode", required = false)
    private String UserCardCode;

    /**
     * 发起方openid
     */
    @Element(name = "FriendUserName", required = false)
    private String FriendUserName;

    /**
     * 旧的code，若为非自定义code，转赠时微信会变更用户的code，非自定义code的商户不必理会该规则。
     */
    @Element(name = "OldUserCardCode", required = false)
    private String OldUserCardCode;

    @Override
    public String toString() {
        return "PushMessage{" +
                "ToUserName='" + ToUserName + '\'' +
                ", FromUserName='" + FromUserName + '\'' +
                ", CreateTime=" + CreateTime +
                ", MsgType='" + MsgType + '\'' +
                ", Event='" + Event + '\'' +
                ", PageId='" + PageId + '\'' +
                ", OrderId='" + OrderId + '\'' +
                ", IsChatRoom=" + IsChatRoom +
                ", IsReturnBack=" + IsReturnBack +
                ", Cardid='" + Cardid + '\'' +
                ", IsGiveByFriend=" + IsGiveByFriend +
                ", UserCardCode='" + UserCardCode + '\'' +
                ", FriendUserName='" + FriendUserName + '\'' +
                ", OldUserCardCode='" + OldUserCardCode + '\'' +
                '}';
    }
}
